﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp
{
    public class MyProperties
    {
        public static void Show()
        {
            int[] baseValues = { 2, 8, 10, 16 };
            short value = Int16.MaxValue;
            foreach (var item in baseValues)
            {
                string s = Convert.ToString(value,item);
                short value2 = Convert.ToInt16(s, item);
                Console.WriteLine("{0} ---> {1} (base {2}) ---> {3}",value,s,item,value2);
            }
        }
    }
    public class Person
    {
        private int m_Age;

        public int Age
        {
            get { return m_Age; }
            set
            {
                if (value < 0 || value > 125)
                {
                    throw new ArgumentOutOfRangeException("年龄必须在0-125岁之间");
                }
                else
                {
                    m_Age = value;
                }
            }
        }
    }
}
